package com.casstime.ec.cloud.discount.dao.giftPromotion;

import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Param;
import com.casstime.ec.cloud.dao.jpa.mybatis.Mapper;
import com.casstime.ec.cloud.values.giftPromotion.GiftPromotion;
import com.casstime.ec.cloud.values.giftPromotion.GiftPromotionRequest;
/**
 * ClassName: AfterSalesPolicyMapper 
 * Function: (买赠促销实体查询DAO)
 * Reason: ADD REASON(可选).
 *  
 * @author wu.chen 
 * 2018年1月30日 上午11:17:38
 * @version   
 * @since JDK 1.8
 */
@SuppressWarnings("rawtypes")
public interface GiftPromotionMapper extends Mapper {
	
	int insertOrUpdateGiftPromotion(@Param("promotion") GiftPromotion promotion);
	
	GiftPromotion findGiftPromotionById(@Param("promotionId") String promotionId);
	
	int deleteGiftPromotionById(@Param("promotionId")String promotionId);
	
	int updateGiftPromotionStatus(@Param("promotionId") String promotionId, @Param("status") String status);
	
	List<GiftPromotion> listGiftPromotionStoreId(@Param("productStoreId") String productStoreId,
			@Param("request") GiftPromotionRequest request);
	
	List<String> validGiftPromotionProducts(@Param("productStoreId") String productStoreId,
			@Param("giftPromotionId") String giftPromotionId, @Param("startDate") Date startDate,
			@Param("endDate") Date endDate, @Param("productIds") List<String> productIds);

}
